import {
  addSpareInfo,
  delSpareInfo,
  updateSpareInfo,
  exportSpareInfo,
  getSpareInfoByPage,
  addSpareFile,
  delSpareFile,
  exportSpareFile,
  getSpareFileByPage,
  updateSpareFile,
  uploadSpareFile,
} from '@/services/device/spareInfo';
import { InfoCircleOutlined, UploadOutlined, PlusOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import type { ActionType, ProColumns } from '@ant-design/pro-table';
import { ModalForm, ProFormText } from '@ant-design/pro-components';
import ProTable from '@ant-design/pro-table';
import {
  Button,
  Tabs,
  Modal,
  Table,
  message,
  Row,
  Col,
  Form,
  DatePicker,
  Tooltip,
  InputNumber,
  Input,
  Upload,
} from 'antd';
import { sortTran, filterTran } from '@/utils/requestUtil';
import React, { useEffect, useRef, useState } from 'react';
import dayjs from 'dayjs';
import './style.less';
import { Document, Page } from 'react-pdf';
import { Ellipsis } from '@/components/Ellipsis';

import { tableSearchPublicConfig } from '@/utils/filterUtils';
import moment from 'moment';

const WorkOrderInfor: React.FC<{}> = () => {
  const actionRef = useRef<ActionType>();
  const [modalVisit, setModalVisit] = useState(false); // 新建和编辑提示框
  const [confirmLoading, setConfirmLoading] = useState(false); //编辑框的disable
  const [formTitle, setFormTitle] = useState(''); //
  const [createOrUpdate, setCreateOrUpdate] = useState(false); //编辑框的disable
  const [form] = Form.useForm();
  const ref = useRef(null);

  const actionRef_file = useRef<ActionType>();
  const [modalVisit4, setModalVisit4] = useState(false); // 上传附件
  const [modalVisit_file, setModalVisit_file] = useState(false); // 上传附件
  const [confirmLoading4, setConfirmLoading4] = useState(false);
  const [confirmLoading_file, setConfirmLoading_file] = useState(false);
  const [formTitle4, setFormTitle4] = useState('新建'); //
  const [formTitle_file, setFormTitle_file] = useState(''); //
  const [file, setFile] = useState();
  const [itemId, setItemId] = useState('');
  const fileInfo = {
    spareinfoId: '',
    // multipartFile: '',
    fileName: '',
    // memo: '11',
  };

  const columns: ProColumns[] = [
    {
      title: '序号',
      dataIndex: 'index',
      valueType: 'index',
      align: 'center',
      sorter: true,
      width: 80,
    },
    /* {
      title: '唯一标识',
      dataIndex: 'identification',
     align: 'center',sorter: true, 

      hideInTable: true,
    }, */
    {
      title: '仓库名称',
      dataIndex: 'warehouseName',
      align: 'center',
      sorter: true,

      width: 120,
      onCell: () => {
        return {
          style: {
            maxWidth: 100,
            overflow: 'hidden',
            whiteSpace: 'nowrap',
            textOverflow: 'ellipsis',
            cursor: 'pointer',
          },
        };
      },
      render: (text) => (
        <Tooltip placement="topLeft" title={text}>
          {text}
        </Tooltip>
      ),
    },
    {
      title: '仓库编号',
      dataIndex: 'warehouseId',
      align: 'center',
      sorter: true,

      width: 120,
      onCell: () => {
        return {
          style: {
            maxWidth: 100,
            overflow: 'hidden',
            whiteSpace: 'nowrap',
            textOverflow: 'ellipsis',
            cursor: 'pointer',
          },
        };
      },
      render: (text) => (
        <Tooltip placement="topLeft" title={text}>
          {text}
        </Tooltip>
      ),
    },
    {
      title: '备件名称',
      dataIndex: 'spareName',
      align: 'center',
      sorter: true,

      width: 120,
      onCell: () => {
        return {
          style: {
            maxWidth: 100,
            overflow: 'hidden',
            whiteSpace: 'nowrap',
            textOverflow: 'ellipsis',
            cursor: 'pointer',
          },
        };
      },
      render: (text) => (
        <Tooltip placement="topLeft" title={text}>
          {text}
        </Tooltip>
      ),
    },
    {
      title: '备件编号',
      dataIndex: 'spareId',
      align: 'center',
      sorter: true,

      width: 120,
      onCell: () => {
        return {
          style: {
            maxWidth: 100,
            overflow: 'hidden',
            whiteSpace: 'nowrap',
            textOverflow: 'ellipsis',
            cursor: 'pointer',
          },
        };
      },
      render: (text) => (
        <Tooltip placement="topLeft" title={text}>
          {text}
        </Tooltip>
      ),
    },
    {
      title: '库位编号',
      dataIndex: 'locationCode',
      align: 'center',
      sorter: true,

      width: 120,
      onCell: () => {
        return {
          style: {
            maxWidth: 100,
            overflow: 'hidden',
            whiteSpace: 'nowrap',
            textOverflow: 'ellipsis',
            cursor: 'pointer',
          },
        };
      },
      render: (text) => (
        <Tooltip placement="topLeft" title={text}>
          {text}
        </Tooltip>
      ),
    },
    {
      title: '规格型号',
      dataIndex: 'spareType',
      align: 'center',
      sorter: true,

      width: 120,
    },
    {
      title: '品牌',
      dataIndex: 'manufacturer',
      align: 'center',
      sorter: true,

      width: 120,
      onCell: () => {
        return {
          style: {
            maxWidth: 100,
            overflow: 'hidden',
            whiteSpace: 'nowrap',
            textOverflow: 'ellipsis',
            cursor: 'pointer',
          },
        };
      },
      render: (text) => (
        <Tooltip placement="topLeft" title={text}>
          {text}
        </Tooltip>
      ),
    },
    {
      title: '供应商',
      dataIndex: 'vendor',
      align: 'center',
      sorter: true,

      width: 120,
      onCell: () => {
        return {
          style: {
            maxWidth: 100,
            overflow: 'hidden',
            whiteSpace: 'nowrap',
            textOverflow: 'ellipsis',
            cursor: 'pointer',
          },
        };
      },
      render: (text) => (
        <Tooltip placement="topLeft" title={text}>
          {text}
        </Tooltip>
      ),
    },
    {
      title: '库存数量',
      dataIndex: 'qty',
      align: 'center',
      sorter: true,

      search: false,
      width: 120,
    },
    {
      title: '单位',
      dataIndex: 'unit',
      align: 'center',
      sorter: true,

      search: false,
      width: 120,
      onCell: () => {
        return {
          style: {
            maxWidth: 100,
            overflow: 'hidden',
            whiteSpace: 'nowrap',
            textOverflow: 'ellipsis',
            cursor: 'pointer',
          },
        };
      },
      render: (text) => (
        <Tooltip placement="topLeft" title={text}>
          {text}
        </Tooltip>
      ),
    },
    {
      title: '可用库存',
      dataIndex: 'availableQTY',
      search: false,
      align: 'center',
      sorter: true,

      width: 80,
      render: (text, record, _, action) => {
        const textStyle = {
          textalign: 'center',

          width: '50px',
          height: '27px',
          padding: '5px',
          borderRadius: '3px',
          color: 'white',
          fontSize: '10px',
          backgroundColor: '#13c2c2',
        };
        if (record.availableQTY >= record.safeQTY) {
          textStyle.backgroundColor = '#338033';
          return <div style={textStyle}>{record.availableQTY}</div>;
        } else {
          textStyle.backgroundColor = '#DC6C76';
          return (
            <div>
              <div style={textStyle}>
                {record.availableQTY}
                {'   '}
                {/* <Tooltip placement="bottom" title="可用库存少于安全库存！">
                  <InfoCircleOutlined />
                </Tooltip> */}
              </div>
            </div>
          );
        }
      },
    },
    {
      title: '安全库存',
      align: 'center',
      sorter: true,

      dataIndex: 'safeQTY',
      width: 80,
      search: false,
    },
    {
      title: '联系人',
      dataIndex: 'contact',
      align: 'center',
      sorter: true,

      search: false,
      width: 80,
    },
    {
      title: '联系方式',
      dataIndex: 'telephone',
      align: 'center',
      sorter: true,

      search: false,
      width: 120,
    },
    {
      title: '采购编号',
      dataIndex: 'contractId',
      align: 'center',
      sorter: true,

      width: 120,
    },
    {
      title: '采购日期',
      dataIndex: 'contractDate',
      align: 'center',
      sorter: true,
      search: false,
      width: 120,
    },
    {
      title: '操作',
      valueType: 'option',
      align: 'center',

      key: 'option',
      fixed: 'right',
      /*      align: 'center',sorter: true, 

      width: 120, */
      render: (text, record, _, action) => [
        <a
          key="uploadFile"
          onClick={() => {
            setItemId(record.id);
            setFormTitle_file('新建');
            setModalVisit_file(true);
          }}
        >
          查看附件
        </a>,
        <a
          key="editKey"
          onClick={() => {
            setModalVisit(true);
            setCreateOrUpdate(false);
            setFormTitle('编辑');
            form.setFieldsValue({
              identification: record.identification,
              warehouseName: record.warehouseName,
              warehouseID: record.warehouseID,
              spareName: record.spareName,
              spareId: record.spareId,
              spareType: record.spareType,
              manufacturer: record.manufacturer,
              isValid: record.isValid,
              vendor: record.vendor,
              QTY: record.QTY,
              locationCode: record.locationCode,
              unit: record.unit,
              availableQTY: record.availableQTY,
              safeQTY: record.safeQTY,
              contact: record.contact,
              telephone: record.telephone,
              contractId: record.contractId,
              contractDate: dayjs(record.contractDate),
              id: record.id,
            });
          }}
        >
          编辑
        </a>,
        <a
          key="deleteKey"
          onClick={() => {
            Modal.confirm({
              title: '删除',
              content: '确定要删除吗',
              okText: '确认',
              cancelText: '取消',
              onOk: async () => {
                await delSpareInfo({ id: record.id });
                actionRef.current!.reload();
              },
            });
          }}
        >
          删除
        </a>,
      ],
    },
  ];
  const handleSubmit = async (values) => {
    setConfirmLoading(true);
    if (formTitle == '新建') {
      const result = await addSpareInfo(values);
      console.log('结果', result);
      if (result != null) {
        message.success('添加成功');
      }
    } else {
      await updateSpareInfo(values);
    }
    setConfirmLoading(false);
    setModalVisit(false);
    actionRef.current.reload();
  };
  const handleClose = async () => {
    setModalVisit_file(false);
  };
  //附件查看
  const fileCol: ProColumns[] = [
    {
      title: '序号',
      align: 'center',
      sorter: true,

      dataIndex: 'index',
      valueType: 'index',
      width: 60,
    },
    /* {
      title: '唯一标识',
      dataIndex: 'identification',
      hideInTable: true,
    }, */
    {
      title: '文件名',
      align: 'center',
      sorter: true,

      dataIndex: 'fileName',
      width: 150,
    },
    /* {
      title: '备注',
      align: 'center',
      sorter: true,
      dataIndex: 'memo',
      search: false,
      width: 200,
      onCell: () => {
        return {
          style: {
            maxWidth: 100,
            overflow: 'hidden',
            whiteSpace: 'nowrap',
            textOverflow: 'ellipsis',
            cursor: 'pointer',
          },
        };
      },
      render: (text) => (
        <Tooltip placement="topLeft" title={text}>
          {text}
        </Tooltip>
      ),
    }, */
    {
      title: '创建日期', //表头显示的名称
      search: false,
      dataIndex: 'createTime',
      width: 90,
      align: 'center',
      sorter: true,
      render: (record) => <a>{moment(record.createTime).format('YYYY-MM-DD')}</a>,
      // render: (text) => <>{Ellipsis(text)}</>,
    },
    {
      title: '创建人', //表头显示的名称
      search: false,
      dataIndex: 'createName',
      width: 90,
      align: 'center',
      sorter: true,

      render: (text) => <>{Ellipsis(text)}</>,
    },
    {
      title: '操作',
      valueType: 'option',
      key: 'option',
      align: 'center',

      width: 120,
      fixed: 'right',
      // width: 238,
      render: (text, record, _, action) => [
        <a
          key="previewKey"
          onClick={() => {
            window.open(record.fileUrl);
            actionRef_file.current!.reload();
          }}
        >
          预览下载
        </a>,
        <a
          key="deleteKey"
          onClick={() => {
            Modal.confirm({
              title: '删除',
              content: '确定要删除吗',
              okText: '确认',
              cancelText: '取消',
              onOk: async () => {
                await delSpareFile({ id: record.id });
                actionRef_file.current!.reload();
              },
            });
          }}
        >
          删除附件
        </a>,
      ],
    },
  ];

  const onFilesChange = async (file) => {
    setFile(file);
  };
  const beforeUpload = (file, fileList) => {
    setFile(file);
    if (fileList.length >= 1) {
      return false; // 阻止上传
    }
    return true; // 允许上传
  };

  //上传附件
  const handleFile = async () => {
    setConfirmLoading4(true);
    console.log('开始上传', formTitle4);
    if (formTitle4 == '新建') {
      form
        .validateFields()
        .then(async (value) => {
          if (file == undefined) message.error('请上传文件！');
          if (file.size / 1024 / 1024 < 100) {
            console.log('上传');
            const info = form.getFieldsValue();
            const formData1 = new window.FormData();
            info.file.fileList.map((file: any) => {
              formData1.append('file', file.originFileObj);
            });
            fileInfo.file = formData1;
            fileInfo.fileName = info.file.file.name;
            fileInfo.spareinfoId = itemId;
            console.log('上传的文件信息：', fileInfo);
            const result = await uploadSpareFile(fileInfo);
            console.log(fileInfo, '成了吗', result);
            if (result != null) {
              message.success('添加成功');
            }
            setFile(undefined);
            setConfirmLoading4(false);
            setModalVisit4(false);
            actionRef_file.current!.reload();
          } else {
            setConfirmLoading4(false);
            message.info('文件大小不能超过100MB!');
          }
          //form.resetFields();
        })
        .catch((err) => {
          setConfirmLoading4(false);
        });
    } /* else {
      form
        .validateFields()
        .then(async () => {
          const res = form.getFieldsValue();
          res.file = new FormData();
          res.infoId = optionsProName.find(
            () => optionsProName.label === form.getFieldsValue.projectName,
          ).value;
          if (file != null) {
            const formData = new window.FormData();
            formData.append('file', file);
            res.file = formData;
          }
          const result = await updateFileInfo(res);
          if (result != null) {
            message.success('修改成功！');
          }
          setConfirmLoading(false);
          setModalVisit(false);
          actionRef.current!.reload();
        })
        .catch(() => {
          setConfirmLoading4(false);
        });
    } */
  };
  return (
    <PageHeaderWrapper title={false} breadcrumb={undefined}>
      <ProTable
        headerTitle="备件库存分析"
        actionRef={actionRef} //用于触发刷新操作等，看api
        rowKey="id" //表格行 key 的取值，可以是字符串或一个函数
        formRef={ref}
        search={{
          // ProTable搜索框配置
          ...tableSearchPublicConfig,
        }}
        toolBarRender={(action, { selectedRows }) => [
          <div className="projectScheduleGroup">
            <span>库存安全 : </span>
            <img className="green" src="../zxz.gif" />
            <span>可用库存小于安全库存 : </span>
            <img src="../red.png" />
          </div>,
          <Button
            key="button"
            icon={<PlusOutlined />}
            onClick={() => {
              setCreateOrUpdate(false);
              setFormTitle('新建');
              form.resetFields();
              setModalVisit(true);
            }}
            type="primary"
          >
            新建
          </Button>,
          <Button
            key="button"
            icon={<PlusOutlined />}
            onClick={() => {
              const filters = filterTran(ref.current.getFieldsValue());
              exportSpareInfo({
                current: 1,
                pageSize: 5000,
                filters: filters,
              }).then((res) => {
                const aLink = document.createElement('a');
                document.body.appendChild(aLink);
                aLink.style.display = 'none';
                aLink.href = window.URL.createObjectURL(res);
                aLink.setAttribute('download', `export.xls`);
                aLink.click();
                document.body.removeChild(aLink);
              });
            }}
            type="primary"
          >
            导出
          </Button>,
        ]}
        request={async (params = {}, sort, filter) => {
          const sorters = sortTran(sort);
          const filters = filterTran(params);
          const result = await getSpareInfoByPage({
            ...params,
            sorters: sorters,
            filters: filters,
          });
          console.log('获取到的Spare页面信息', result);
          return {
            data: result.data.content,
            total: result.data.totalElements,
            success: result.success,
          };
        }}
        columns={columns}
        scroll={{ x: 1500, y: 350 }}
        rowSelection={{}}
      />
      <ModalForm
        layout="horizontal"
        labelCol={{ span: 8 }}
        wrapperCol={{ span: 16 }}
        visible={modalVisit}
        title={formTitle}
        form={form}
        onFinish={handleSubmit}
        modalProps={{
          destroyOnClose: true,
          onCancel: () => {
            setModalVisit(false);
          },
        }}
      >
        <ProFormText name="id" label="id" placeholder="请输入名称" hidden={true} />
        <ProFormText
          name="identification"
          label="唯一标识"
          initialValue={111}
          disabled={createOrUpdate}
          hidden={true}
        />
        <Row gutter={[50, 0]}>
          <Col span={12}>
            <ProFormText
              name="warehouseName"
              label="仓库名称"
              disabled={createOrUpdate}
              tooltip="最长为 20 位"
              rules={[
                { required: true, message: '请输入仓库名称!' },
                { max: 20, message: '仓库名称长度最长为20!' },
              ]}
            />
          </Col>
          <Col span={12}>
            <ProFormText
              name="warehouseId"
              label="仓库编号"
              disabled={createOrUpdate}
              rules={[{ required: true, message: '请输入仓库编号!' }]}
            />
          </Col>
        </Row>
        <Row gutter={[50, 0]}>
          <Col span={12}>
            <ProFormText
              name="spareName"
              label="备件名称"
              disabled={createOrUpdate}
              tooltip="最长为 20 位"
              rules={[{ max: 20, message: '备件名称长度最长为20!' }]}
            />
          </Col>
          <Col span={12}>
            <ProFormText name="spareId" label="备件编号" disabled={createOrUpdate} />
          </Col>
        </Row>
        <Row gutter={[50, 0]}>
          <Col span={12}>
            <Form.Item
              name="contractDate"
              label="采购日期"
              rules={[{ required: true, message: '请选择采购日期! ' }]}
            >
              <DatePicker style={{ width: '100%' }} />
            </Form.Item>
          </Col>
          <Col span={12}>
            <ProFormText name="spareType" label="规格型号" disabled={createOrUpdate} />
          </Col>
        </Row>
        <Row gutter={[50, 0]}>
          <Col span={12}>
            <ProFormText name="manufacturer" label="品牌" disabled={createOrUpdate} />
          </Col>
          <Col span={12}>
            <ProFormText name="vendor" label="供应商" disabled={createOrUpdate} />
          </Col>
        </Row>
        <Row gutter={[50, 0]}>
          <Col span={12}>
            <Form.Item
              label="库存数量"
              name="qty"
              rules={[{ required: true, message: '请输入库存数量!' }]}
            >
              <InputNumber
                addonAfter="件"
                min={0}
                max={99999}
                style={{ width: '100%' }}
                step={1}
                // onChange={(e) => handlestandManufactWorkHourChange(e.target.value)}
              />
            </Form.Item>
          </Col>
          <Col span={12}>
            <ProFormText name="unit" label="单位" disabled={createOrUpdate} />
          </Col>
        </Row>
        <Row gutter={[50, 0]}>
          <Col span={12}>
            <Form.Item
              label="可用库存"
              name="availableQTY"
              rules={[{ required: true, message: '请输入可用库存!' }]}
            >
              <InputNumber
                addonAfter="件"
                min={0}
                max={99999}
                style={{ width: '100%' }}
                step={1}
                // onChange={(e) => handlestandManufactWorkHourChange(e.target.value)}
              />
            </Form.Item>
            {/*  <ProFormText
              name="availableQTY"
              label="可用库存"
              disabled={createOrUpdate}
              rules={[{ required: true, message: '请输入!' }]}
            /> */}
          </Col>
          <Col span={12}>
            <Form.Item
              label="安全库存"
              name="safeQTY"
              rules={[{ required: true, message: '请输入安全库存!' }]}
            >
              <InputNumber
                addonAfter="件"
                style={{ width: '100%' }}
                min={0}
                max={99999}
                step={1}
                // onChange={(e) => handlestandManufactWorkHourChange(e.target.value)}
              />
            </Form.Item>
            {/* <ProFormText
              name="safeQTY"
              label="安全库存"
              disabled={createOrUpdate}
              rules={[{ required: true, message: '请输入!' }]}
            /> */}
          </Col>
        </Row>
        <Row gutter={[50, 0]}>
          <Col span={12}>
            <ProFormText name="contact" label="联系人" disabled={createOrUpdate} />
          </Col>
          <Col span={12}>
            <ProFormText name="telephone" label="联系方式" disabled={createOrUpdate} />
          </Col>
        </Row>
        <Row gutter={[50, 0]}>
          <Col span={12}>
            <ProFormText name="contractId" label="采购编号" disabled={createOrUpdate} />
          </Col>
          <Col span={12}>
            <ProFormText name="locationCode" label="库位编号" disabled={createOrUpdate} />
          </Col>
        </Row>
      </ModalForm>
      {/* 附件弹窗 */}
      <Modal
        title={formTitle4}
        visible={modalVisit4}
        onOk={handleFile}
        confirmLoading={confirmLoading4}
        onCancel={() => setModalVisit4(false)}
        destroyOnClose
      >
        <Form
          name="wrap"
          labelCol={{ flex: '110px' }}
          labelAlign="left"
          labelWrap
          form={form}
          wrapperCol={{ flex: 1 }}
          colon={false}
        >
          <Form.Item
            label="附件"
            name="file"
            rules={[{ required: true, message: '请选择待上传文件！' }]}
          >
            <Upload
              //listType="picture-card"
              file-list="fileList"
              customRequest={onFilesChange} //通过覆盖默认的上传行为，可以自定义自己的上传实现
              showUploadList={true}
              multiple
              beforeUpload={beforeUpload}
            >
              <Button icon={<UploadOutlined />}>上传文件</Button>
            </Upload>
          </Form.Item>
          {/* <Form.Item label="备注" name="memo" rules={[{ required: true, message: '请输入备注!' }]}>
            <Input />
          </Form.Item> */}
        </Form>
      </Modal>
      {/* 附件table弹窗 */}
      <ModalForm
        form={form}
        title={formTitle_file}
        visible={modalVisit_file}
        width={1200}
        onFinish={handleClose}
        confirmLoading={confirmLoading_file}
        modalProps={{
          destroyOnClose: true,
          onCancel: () => {
            setModalVisit_file(false);
          },
        }}
      >
        <ProFormText name="id" label="id" placeholder="请输入名称" hidden={true} />
        <ProFormText
          name="identification"
          label="唯一标识"
          rules={[{ required: true, message: '请输入 your identification!' }]}
          disabled={createOrUpdate}
          initialValue={111}
          hidden={true}
        />
        <ProTable
          headerTitle="附件信息"
          actionRef={actionRef_file} //用于触发刷新操作等，看api
          rowKey="id" //表格行 key 的取值，可以是字符串或一个函数
          formRef={ref}
          search={false}
          /* search={{
            labelWidth: 100,
            defaultCollapsed: true,
          }} */
          toolBarRender={(action, { selectedRows }) => [
            <Button
              key="button"
              icon={<PlusOutlined />}
              onClick={() => {
                setFormTitle4('新建');

                setModalVisit4(true);
              }}
              type="primary"
            >
              新建
            </Button>,
            /*  <Button
              key="button"
              icon={<PlusOutlined />}
              onClick={() => {
                const filters = filterTran(ref.current.getFieldsValue());
                exportSpareItem({
                  current: 1,
                  pageSize: 5000,
                  filters: filters,
                }).then((res) => {
                  const aLink = document.createElement('a');
                  document.body.appendChild(aLink);
                  aLink.style.display = 'none';
                  aLink.href = window.URL.createObjectURL(res);
                  aLink.setAttribute('download', `SpareItem.xls`);
                  aLink.click();
                  document.body.removeChild(aLink);
                });
              }}
              type="primary"
            >
              导出
            </Button>, */
          ]}
          request={async (params = {}, sort, filter) => {
            const res = { ...params };
            const sorters = sortTran(sort);
            const filters = filterTran(res);
            const result = await getSpareFileByPage({
              ...params,
              sorters: sorters,
              filters: filters,
            });
            //getproductbop();
            //过滤后端传递的null数据
            console.log('获得的文件信息', result);
            const tableinfo2: any[] = [];
            result.data.content.map((item: any, index: number) => {
              if (item != null && item.spareinfoId == itemId) {
                tableinfo2.push(item);
              }
            });
            console.log('应该显示的文件信息啊', tableinfo2);
            return {
              data: tableinfo2,
              total: tableinfo2.length,
              success: result.success,
            };
          }}
          columns={fileCol}
          scroll={{ x: 1000, y: 450 }}
          rowSelection={{}}
        />
      </ModalForm>
    </PageHeaderWrapper>
  );
};
export default WorkOrderInfor;
